import React, { Suspense } from 'react'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
const Upload = React.lazy(() => import('./views/upload'))
const UploadKoa = React.lazy(() => import('./views/upload-koa'))
const UploadAliOss = React.lazy(() => import('./views/upload-ali-oss'))
const MainLayout = React.lazy(() => import('./views/mainLayout'))
const Index: React.FC = () => {
  return (
    <BrowserRouter>
      <Suspense>
        <Routes>
          <Route path='/' element={<MainLayout></MainLayout>}>
            <Route path='/' element={<Upload></Upload>}></Route>
            <Route path='/upload/koa' element={<UploadKoa></UploadKoa>}></Route>
            <Route path='/upload/ali/oss' element={<UploadAliOss></UploadAliOss>}></Route>
          </Route>
        </Routes>
      </Suspense>

    </BrowserRouter>
  )
}

export default Index